﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Resources;

namespace client.helpers
{
    public class LocStringHelper
    {
        private static LocStringHelper _instance = null;
        private static ResourceManager _resourceMgr = null;
        private static readonly object _locker = new object();

        private LocStringHelper() { }

        public static LocStringHelper GetInstance()
        {
            if (_instance == null)
            {
                lock (_locker)
                {
                    if (_instance == null)
                    {
                        _instance = new LocStringHelper();
                        _resourceMgr = new ResourceManager($"client.resources.en_us.Resource", typeof(LocStringHelper).Assembly);
                    }
                }
            }

            return _instance;
        }

        public string GetString(string resourceId)
        {
            return _resourceMgr.GetString(resourceId);
        }
    }
}
